<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Title</title>
</head>
<body>
    <div id="app">
        <my-component>
            <h3>内容区域</h3>
        </my-component>
    </div>

    <template id="mycomponent">
        <div>
            <p>头部区域</p>
            <slot>如果没有分发内容，则显示默认提示</slot>
            <p>底部区域</p>
        </div>
    </template>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script type="text/javascript">
    var vm = new Vue({
        el: "#app",
        data:{

        },
        components:{
            "my-component": {
                template: "#mycomponent"
            }
        }
    })
</script>
</html>